import request from '@/utils/request'

/**
 * 关联用户
 */
export function relateUsers(data) {
	return request({
		url: '/api/sys/role/relateUsers',
		method: 'post',
		data
	})
}

/**
 * 取消关联用户
 */
export function unRelateUser(roleId, userId) {
	return request({
		url: '/api/sys/role/unRelateUser/' + roleId + '/' + userId,
		method: 'delete'
	})
}

/**
 * 授权菜单资源
 */
export function authorizeMenu(data) {
	return request({
		url: '/api/sys/role/authorizeMenu',
		method: 'post',
		data
	})
}

/**
 * 授权按钮资源
 */
export function authorizeApi(data) {
	return request({
		url: '/api/sys/role/authorizeApi',
		method: 'post',
		data
	})
}
